home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / addflo / data1.cab / Program_Executable_Files / AddFlow / Samples / Demo / Main.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1997-05-06  |  14.4 KB  |  422 lines

  1. VERSION 4.00
  2. Begin VB.MDIForm frmMain 
  3.    Appearance      =   0  'Flat
  4.    BackColor       =   &H8000000C&
  5.    Caption         =   "AddFlow ActiveX Demonstration"
  6.    ClientHeight    =   5040
  7.    ClientLeft      =   960
  8.    ClientTop       =   1470
  9.    ClientWidth     =   8460
  10.    Height          =   5730
  11.    Icon            =   "Main.frx":0000
  12.    Left            =   900
  13.    LinkTopic       =   "Main"
  14.    Top             =   840
  15.    Width           =   8580
  16.    Begin VB.PictureBox PictureComments 
  17.       Align           =   1  'Align Top
  18.       BackColor       =   &H00C0C0C0&
  19.       FillColor       =   &H00C0C0C0&
  20.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  21.          Name            =   "MS Sans Serif"
  22.          Size            =   8.25
  23.          Charset         =   0
  24.          Weight          =   700
  25.          Underline       =   0   'False
  26.          Italic          =   0   'False
  27.          Strikethrough   =   0   'False
  28.       EndProperty
  29.       Height          =   1215
  30.       Left            =   0
  31.       ScaleHeight     =   1155
  32.       ScaleWidth      =   8400
  33.       TabIndex        =   0
  34.       Top             =   0
  35.       Width           =   8460
  36.       Begin VB.TextBox Text1 
  37.          Height          =   1035
  38.          Left            =   90
  39.          MultiLine       =   -1  'True
  40.          TabIndex        =   1
  41.          Top             =   60
  42.          Width           =   6705
  43.       End
  44.    End
  45.    Begin VB.Menu FileMenu 
  46.       Caption         =   "&File"
  47.       Begin VB.Menu PrintformMenu 
  48.          Caption         =   "&Print form"
  49.       End
  50.       Begin VB.Menu Exitmenu 
  51.          Caption         =   "&Exit"
  52.       End
  53.    End
  54.    Begin VB.Menu EditMenu 
  55.       Caption         =   "&Edit"
  56.       Begin VB.Menu CopyMenu 
  57.          Caption         =   "&Copy to clipboard"
  58.       End
  59.       Begin VB.Menu DeleteMenu 
  60.          Caption         =   "&Delete selected items"
  61.       End
  62.       Begin VB.Menu SEPARATOR1 
  63.          Caption         =   "-"
  64.       End
  65.       Begin VB.Menu SelectAllMenu 
  66.          Caption         =   "Select &all"
  67.       End
  68.       Begin VB.Menu SEPARATOR3 
  69.          Caption         =   "-"
  70.       End
  71.       Begin VB.Menu SelectModeMenu 
  72.          Caption         =   "Select &Mode"
  73.       End
  74.       Begin VB.Menu SEPARATOR5 
  75.          Caption         =   "-"
  76.       End
  77.       Begin VB.Menu ZOrderMenu 
  78.          Caption         =   "&ZOrder"
  79.          Begin VB.Menu BackMenu 
  80.             Caption         =   "&Back"
  81.          End
  82.          Begin VB.Menu ForeMenu 
  83.             Caption         =   "&Fore"
  84.          End
  85.       End
  86.    End
  87.    Begin VB.Menu ShowMenu 
  88.       Caption         =   "&Show"
  89.       Begin VB.Menu ShowExample 
  90.          Caption         =   "&WorkFlow"
  91.          Index           =   0
  92.       End
  93.       Begin VB.Menu ShowExample 
  94.          Caption         =   "&NetWork"
  95.          Index           =   1
  96.       End
  97.       Begin VB.Menu ShowExample 
  98.          Caption         =   "&Diagram"
  99.          Index           =   2
  100.       End
  101.       Begin VB.Menu ShowExample 
  102.          Caption         =   "&FlowChart"
  103.          Index           =   3
  104.       End
  105.       Begin VB.Menu SEPARATOR 
  106.          Caption         =   "-"
  107.       End
  108.       Begin VB.Menu CommentsMenu 
  109.          Caption         =   "&Comments"
  110.       End
  111.    End
  112.    Begin VB.Menu ZoomMenu 
  113.       Caption         =   "&Zoom"
  114.       Begin VB.Menu ZoomValueMenu 
  115.          Caption         =   "&100% (Normal)"
  116.          Index           =   0
  117.       End
  118.       Begin VB.Menu ZoomValueMenu 
  119.          Caption         =   "&200%"
  120.          Index           =   1
  121.       End
  122.       Begin VB.Menu ZoomValueMenu 
  123.          Caption         =   "&50%"
  124.          Index           =   2
  125.       End
  126.       Begin VB.Menu ZoomValueMenu 
  127.          Caption         =   "0% (Fit in Window)"
  128.          Index           =   3
  129.       End
  130.    End
  131.    Begin VB.Menu CapabilitiesMenu 
  132.       Caption         =   "&Capabilities"
  133.       Begin VB.Menu MultiSelectionMenu 
  134.          Caption         =   "Multi &Selection"
  135.       End
  136.       Begin VB.Menu ReadOnlyMenu 
  137.          Caption         =   "&Read Only"
  138.       End
  139.       Begin VB.Menu CanSizeNodeMenu 
  140.          Caption         =   "Can Si&ze node"
  141.       End
  142.       Begin VB.Menu CanMoveNodemenu 
  143.          Caption         =   "Can &Move node"
  144.       End
  145.       Begin VB.Menu CanStretchLinkMenu 
  146.          Caption         =   "Can S&tretch link"
  147.       End
  148.       Begin VB.Menu CanMultiLinkMenu 
  149.          Caption         =   "Can M&ulti link"
  150.       End
  151.       Begin VB.Menu CanDrawNodeMenu 
  152.          Caption         =   "Can Draw &Node"
  153.       End
  154.       Begin VB.Menu CanDrawLinkMenu 
  155.          Caption         =   "Can Draw &Link"
  156.       End
  157.       Begin VB.Menu AutoScrollMenu 
  158.          Caption         =   "&AutoScroll"
  159.       End
  160.       Begin VB.Menu DisplayHandlesMenu 
  161.          Caption         =   "&Display Handles"
  162.       End
  163.    End
  164.    Begin VB.Menu WindowMenu 
  165.       Caption         =   "&Window"
  166.       WindowList      =   -1  'True
  167.       Begin VB.Menu CascadeMenu 
  168.          Caption         =   "&Cascade"
  169.       End
  170.       Begin VB.Menu TileMenu 
  171.          Caption         =   "&Tile"
  172.       End
  173.       Begin VB.Menu ReorganizeMenu 
  174.          Caption         =   "&Reorganize"
  175.       End
  176.    End
  177.    Begin VB.Menu InfoMenu 
  178.       Caption         =   "&Info"
  179.       Begin VB.Menu AboutMenu 
  180.          Caption         =   "&About..."
  181.       End
  182.    End
  183. Attribute VB_Name = "frmMain"
  184. Attribute VB_Creatable = False
  185. Attribute VB_Exposed = False
  186. Option Explicit
  187. Const CASCADE = 0
  188. Const MOZAIQUE_HORIZONTALE = 1
  189. Const MOZAIQUE_VERTICALE = 2
  190. Const REORGANISER_ICONES = 3
  191. Const INFO11 = " In this example, the purpose is to associate actors (Transparent blue nodes) to task items (yellow nodes). "
  192. Const INFO12 = " You can't change the process diagram. You can only move and resize nodes or stretch links. This limitation is added here in order to demonstrate how easy it is to customize your application."
  193. Const INFO13 = " Therefore, you may create new actor node or change actor names by double-clicking over actor node and you may also create links between actor nodes and task nodes (Ex.: Jane - Order Entry). A dialog box is displayed when The DBLCLICK event is received."
  194. Const INFO14 = " Note that when mouse is over a sizing square, the mouse pointer is changing, depending on its position. (See PointedArea property in the help file)"
  195. Const INFO21 = " Double-click on an item (node or link) and you'll be able to change the properties of this item. "
  196. Const INFO22 = " The long flat node (which symbolizes the local network) owns 5 little nodes implementing stubs. INTERNET node own all nodes inside itself (same with the INTRANET node). "
  197. Const INFO23 = " See Owner property in order to know how to create ownership between nodes. "
  198. Const INFO31 = " Here, you have a way to combine the node and link add into a single step. "
  199. Const INFO32 = " You bring the mouse cursor into the handle at the center of the selected node, press the left button, move the mouse where you want but not over a node. Then you release the left button and you'll see that a node and a link are created together."
  200. Const INFO33 = " Note also that when you create a node with the mouse, there is a mimimal node size (See Nodes.Add event in the help file to see how to do that)."
  201. Const INFO34 = " Note that when mouse is over a sizing square, the mouse pointer is changing, depending on its position. (See PointedArea property in the help file)"
  202. Const INFO41 = " In this example, node sizes are adjusted to picture sizes (See property AutoSize). In such a case, text is displayed inside picture."
  203. Const INFO42 = " Therefore, you can't change node size unless you change AutoSize property"
  204. Sub CheckZoomMenu()
  205.   Dim Zoom%, i%
  206.   Zoom = ActiveForm.AddFlow1.xZoom
  207.   Select Case Zoom
  208.   Case 100
  209.     i = 0
  210.   Case 200
  211.     i = 1
  212.   Case 50
  213.     i = 2
  214.   Case 0
  215.     i = 3
  216.   End Select
  217.   ZoomValueMenu(i).Checked = True
  218. End Sub '
  219. Sub ActivateForm()
  220.   CheckZoomMenu
  221.   With ActiveForm.AddFlow1
  222.     ReadOnlyMenu.Checked = .ReadOnly
  223.     MultiSelectionMenu.Checked = .MultiSel
  224.     CanSizeNodeMenu.Checked = .CanSizeNode
  225.     CanMoveNodemenu.Checked = .CanMoveNode
  226.     CanStretchLinkMenu.Checked = .CanStretchLink
  227.     CanMultiLinkMenu.Checked = .CanMultiLink
  228.     CanDrawNodeMenu.Checked = .CanDrawNode
  229.     CanDrawLinkMenu.Checked = .CanDrawLink
  230.     AutoScrollMenu.Checked = .AutoScroll
  231.   End With
  232.   Dim crlf$
  233.   crlf = Chr$(13) + Chr$(10)
  234.   Select Case ActiveForm.Tag
  235.   Case 1
  236.     Text1.Text = INFO11 + crlf + INFO12 + crlf + INFO13 + crlf + INFO14
  237.   Case 2
  238.     Text1.Text = INFO21 + crlf + INFO22 + crlf + INFO23
  239.   Case 3
  240.     Text1.Text = INFO31 + crlf + INFO32 + crlf + INFO33 + crlf + INFO34
  241.   Case 4
  242.     Text1.Text = INFO41 + crlf + INFO42
  243.   End Select
  244. End Sub
  245. Sub DeactivateForm()
  246.   With Me
  247.     Dim i%
  248.     For i = 0 To 3
  249.       .ZoomValueMenu(i).Checked = False
  250.     Next
  251.     .ReadOnlyMenu.Checked = False
  252.     .MultiSelectionMenu.Checked = False
  253.     .CanSizeNodeMenu.Checked = False
  254.     .CanMoveNodemenu.Checked = False
  255.     .CanStretchLinkMenu.Checked = False
  256.     .CanMultiLinkMenu.Checked = False
  257.     .CanDrawNodeMenu.Checked = False
  258.     .CanDrawLinkMenu.Checked = False
  259.     .AutoScrollMenu.Checked = False
  260.   End With
  261. End Sub
  262. Private Sub AboutMenu_Click()
  263.   MsgBox "AddFlow demonstration" + Chr(13) + "Copyright 
  264.  1997 Lassalle Technologies"
  265. End Sub
  266. Private Sub AutoScrollMenu_Click()
  267.   If ActiveForm Is Nothing Then Exit Sub
  268.   ActiveForm.AddFlow1.AutoScroll = Not ActiveForm.AddFlow1.AutoScroll
  269.   AutoScrollMenu.Checked = ActiveForm.AddFlow1.AutoScroll
  270. End Sub
  271. Private Sub BackMenu_Click()
  272.   If ActiveForm Is Nothing Then Exit Sub
  273.   If ActiveForm.AddFlow1.SelectedNode Is Nothing And ActiveForm.AddFlow1.SelectedLink Is Nothing Then
  274.     ' Nothing to do
  275.   ElseIf ActiveForm.AddFlow1.SelectedNode Is Nothing Then
  276.     ActiveForm.AddFlow1.SelectedLink.ZOrder = True
  277.   Else
  278.     ActiveForm.AddFlow1.SelectedNode.ZOrder = True
  279.   End If
  280. End Sub
  281. Private Sub CanDrawLinkMenu_Click()
  282.   If ActiveForm Is Nothing Then Exit Sub
  283.   ActiveForm.AddFlow1.CanDrawLink = Not ActiveForm.AddFlow1.CanDrawLink
  284.   CanDrawLinkMenu.Checked = ActiveForm.AddFlow1.CanDrawLink
  285.   ActiveForm.AddFlow1.Refresh
  286. End Sub
  287. Private Sub CanDrawNodeMenu_Click()
  288.   If ActiveForm Is Nothing Then Exit Sub
  289.   ActiveForm.AddFlow1.CanDrawNode = Not ActiveForm.AddFlow1.CanDrawNode
  290.   CanDrawNodeMenu.Checked = ActiveForm.AddFlow1.CanDrawNode
  291. End Sub
  292. Private Sub CanMoveNodemenu_Click()
  293.   If ActiveForm Is Nothing Then Exit Sub
  294.   ActiveForm.AddFlow1.CanMoveNode = Not ActiveForm.AddFlow1.CanMoveNode
  295.   CanMoveNodemenu.Checked = ActiveForm.AddFlow1.CanMoveNode
  296. End Sub
  297. Private Sub CanMultiLinkMenu_Click()
  298.   If ActiveForm Is Nothing Then Exit Sub
  299.   ActiveForm.AddFlow1.CanMultiLink = Not ActiveForm.AddFlow1.CanMultiLink
  300.   CanMultiLinkMenu.Checked = ActiveForm.AddFlow1.CanMultiLink
  301. End Sub
  302. Private Sub CanSizeNodeMenu_Click()
  303.   If ActiveForm Is Nothing Then Exit Sub
  304.   ActiveForm.AddFlow1.CanSizeNode = Not ActiveForm.AddFlow1.CanSizeNode
  305.   CanSizeNodeMenu.Checked = ActiveForm.AddFlow1.CanSizeNode
  306.   ActiveForm.AddFlow1.Refresh
  307. End Sub
  308. Private Sub CanStretchLinkMenu_Click()
  309.   If ActiveForm Is Nothing Then Exit Sub
  310.   ActiveForm.AddFlow1.CanStretchLink = Not ActiveForm.AddFlow1.CanStretchLink
  311.   CanStretchLinkMenu.Checked = ActiveForm.AddFlow1.CanStretchLink
  312.   ActiveForm.AddFlow1.Refresh
  313. End Sub
  314. Private Sub CascadeMenu_Click()
  315.   Arrange CASCADE
  316. End Sub
  317. Private Sub CommentsMenu_Click()
  318.   PictureComments.Visible = Not PictureComments.Visible
  319. End Sub
  320. Private Sub CopyMenu_Click()
  321.   If ActiveForm Is Nothing Then Exit Sub
  322.   ActiveForm.AddFlow1.SaveImage 1, 0, ""
  323. End Sub
  324. Private Sub DeleteMenu_Click()
  325.   If ActiveForm Is Nothing Then Exit Sub
  326.   ActiveForm.AddFlow1.DeleteSel
  327. End Sub
  328. Private Sub DisplayHandlesMenu_Click()
  329.   If ActiveForm Is Nothing Then Exit Sub
  330.   ActiveForm.AddFlow1.DisplayHandles = Not ActiveForm.AddFlow1.DisplayHandles
  331.   DisplayHandlesMenu.Checked = ActiveForm.AddFlow1.DisplayHandles
  332.   ActiveForm.AddFlow1.Refresh
  333. End Sub
  334. Private Sub Exitmenu_Click()
  335.   Unload Me
  336. End Sub
  337. Private Sub ForeMenu_Click()
  338.   If ActiveForm Is Nothing Then Exit Sub
  339.   If ActiveForm.AddFlow1.SelectedNode Is Nothing And ActiveForm.AddFlow1.SelectedLink Is Nothing Then
  340.     ' Nothing to do
  341.   ElseIf ActiveForm.AddFlow1.SelectedNode Is Nothing Then
  342.     ActiveForm.AddFlow1.SelectedLink.ZOrder = False
  343.   Else
  344.     ActiveForm.AddFlow1.SelectedNode.ZOrder = False
  345.   End If
  346. End Sub
  347. Private Sub MDIForm_Load()
  348.   Me.WindowState = 2
  349.   frmWorkflow.Show
  350.   frmNetwork.Show
  351.   frmDiagram.Show
  352.   frmFlowchar.Show
  353.   TileMenu_Click
  354. End Sub
  355. Private Sub MultiSelectionMenu_Click()
  356.   If ActiveForm Is Nothing Then Exit Sub
  357.   ActiveForm.AddFlow1.MultiSel = Not ActiveForm.AddFlow1.MultiSel
  358.   MultiSelectionMenu.Checked = ActiveForm.AddFlow1.MultiSel
  359. End Sub
  360. Private Sub PrintformMenu_Click()
  361.   ActiveForm.PrintForm
  362. End Sub
  363. Private Sub ReadOnlyMenu_Click()
  364.   If ActiveForm Is Nothing Then Exit Sub
  365.   ActiveForm.AddFlow1.ReadOnly = Not ActiveForm.AddFlow1.ReadOnly
  366.   ReadOnlyMenu.Checked = ActiveForm.AddFlow1.ReadOnly
  367.   ActiveForm.AddFlow1.Refresh
  368. End Sub
  369. Private Sub ReorganizeMenu_Click()
  370.   Arrange REORGANISER_ICONES
  371. End Sub
  372. Private Sub SelectAllMenu_Click()
  373.   If ActiveForm Is Nothing Then Exit Sub
  374.   ActiveForm.AddFlow1.SelectAll
  375. End Sub
  376. Private Sub SelectModeMenu_Click()
  377.   If ActiveForm Is Nothing Then Exit Sub
  378.   ActiveForm.AddFlow1.SelectMode = Not ActiveForm.AddFlow1.SelectMode
  379.   If ActiveForm.AddFlow1.SelectMode = True Then
  380.     SelectModeMenu.Checked = True
  381.     ActiveForm.AddFlow1.MousePointer = 2
  382.   Else
  383.     SelectModeMenu.Checked = False
  384.     ActiveForm.AddFlow1.MousePointer = 0
  385.   End If
  386. End Sub
  387. Private Sub ShowExample_Click(Index As Integer)
  388.   Select Case Index
  389.   Case 0
  390.     frmWorkflow.Show
  391.   Case 1
  392.     frmNetwork.Show
  393.   Case 2
  394.     frmDiagram.Show
  395.   Case 3
  396.     frmFlowchar.Show
  397.   End Select
  398. End Sub
  399. Private Sub TileMenu_Click()
  400.   Arrange MOZAIQUE_HORIZONTALE
  401. End Sub
  402. Private Sub ZoomValueMenu_Click(Index As Integer)
  403.   Dim Zoom%, i%
  404.   If ActiveForm Is Nothing Then Exit Sub
  405.   For i = 0 To 3
  406.     ZoomValueMenu(i).Checked = False
  407.   Next
  408.   Select Case Index
  409.   Case 0
  410.     Zoom = 100
  411.   Case 1
  412.     Zoom = 120 '200
  413.   Case 2
  414.     Zoom = 75 '50
  415.   Case 3
  416.     Zoom = 0
  417.   End Select
  418.   ZoomValueMenu(Index).Checked = True
  419.   ActiveForm.AddFlow1.xZoom = Zoom
  420.   ActiveForm.AddFlow1.yZoom = Zoom
  421. End Sub
  422.